<?php

use yii\db\Migration;

/**
 * Class m190313_074823_wx_cardpage
 */
class m190313_074823_wx_cardpage extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
        $this->createTable('wx_cardpage', [
            'id'            => $this->primaryKey()->notNull()->unsigned()->comment('卡券消息主键id'),
            'cardpage_name' => $this->string(63)->notNull()->defaultValue('')->comment('卡券货架名称'),
            'page_url'      => $this->string(500)->notNull()->defaultValue('')->comment('卡券货架页面地址，微信返回的'),
            'page_id'       => $this->bigInteger(11)->notNull()->defaultValue(0)->comment('货架ID，微信返回的'),
        ], $tableOptions);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m190313_074823_wx_cardpage cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190313_074823_wx_cardpage cannot be reverted.\n";

        return false;
    }
    */
}
